package com.gzk.oeno.tech.set;

import com.gzk.utils.collections.Pair;
import com.gzk.utils.data.IdObject;

public class IdPair<U, V> extends Pair<U, V> implements IdObject<U>{

	public IdPair(U first, V second) {
		super(first, second);
	}

	@Override
	public U getId() {
		return getFirst();
	}

	@Override
	public void setId(U key) {}

	public int hashCode(){
		return getId().hashCode();
	}
	
	public boolean equals(Object other){
		if (other instanceof IdPair<?, ?>)
			return getId().equals(((IdPair<?, ?>)other).getId());
		return false;
	}
}
